require("./hold.less");

function $(selector) {
	let NodeList = document.querySelectorAll(selector);
	switch (NodeList.length) {
		case 0:
			return console.warn(`${selector}未获取到节点`);

		case 1:
			return NodeList[0];

		default:
			return NodeList;
	}
}
let i = 5;
let timer = setInterval(() => {
	i--;
	$("#countDown").textContent = `${i}s`;
	if (i <= 0) {
		clearInterval(timer);
		location.href = "login.html";
	}
}, 1000);

$("button").addEventListener("click", function () {
	location.href = "index.html";
});
